package com.order.controller;  

import java.io.File;

import com.jfinal.core.Controller;

/** 
 * @Title: BaseController.java 
 * @Package com.order.controller 
 * @Description: 公共控制器
 * @author LinBo
 * @date 2014-3-25 下午11:02:42 
 */
public class BaseController extends Controller {

	public static void main(String[] args) {
		String oldPath = "D:/workspace/Eclipse/orders/WebRoot/upload/temp/20140509_233307.png";
		String name = oldPath.substring(oldPath.lastIndexOf("/") + 1);
		String newPath = oldPath.substring(0, oldPath.lastIndexOf(name))
								.replace("temp", "cuisine/" + 5 + "/");
		File path = new File("D:/workspace/Eclipse/orders/WebRoot/upload/cuisine/8/");
		File newFile = new File(path, "20140509_233307.png");
		File oldFile = new File(oldPath);
		System.out.println(oldPath);
		System.out.println(oldFile.exists());
		oldFile.renameTo(newFile);
		oldFile.deleteOnExit();
	}
}
  